#! /bin/bash
export LANG=zh_CN.UTF-8
HIVE_HOME=/usr/bin/hive

${HIVE_HOME} -S -e "

insert overwrite table edu_dwd.dt_scrm_employee
select
  id,
  department_id,
  department_name,
  scrm_department_id,
  superior_leaders_id,
  tdepart_id,
  tenant,
  ems_user_name
from edu_ods.scrm_employee;


insert overwrite table edu_dwd.dt_scrm_department
select *
from edu_ods.scrm_department;


insert overwrite table edu_dwd.dt_scrm_itcast_clazz
select *
from edu_ods.scrm_itcast_clazz;
insert overwrite table edu_dwd.ft_scrm_customer_appeal
select *
from edu_ods.scrm_customer_appeal;

insert overwrite table edu_dwd.ft_scrm_customer_relationship
select
    id,
    create_date_time,
    update_date_time,
    deleted,
    customer_id,
    business_scrm_department_id,
    origin_type,
    itcast_school_id,
    itcast_subject_id,
    creator,
    current_creator,
    creator_name,
    origin_channel,
    comment,
    payment_state,
    payment_time,
    itcast_clazz_id,
    itcast_clazz_time,
    ems_student_id,
    appeal_id
from edu_ods.scrm_customer_relationship;
"